home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet internetowy / Czytniki RSS / RSS Bandit 1.3.0.42 / RssBandit Installer.msi / _172FF5180BC61D3C6D240F14338A23AA / _F35AEE02DA4E4498B4738B9B013B6BA9 < prev    next >
Extensible Markup Language  |  2004-12-30  |  7KB  |  271 lines

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/rss/1.0/" xmlns:fd="http://www.bradsoft.com/feeddemon/xmlns/1.0/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">
  3. <xsl:output method="html"/>
  4.  
  5.  
  6. <!-- type 1 if you want sticky notes to be randomly auto-displaced in group/channel newspaper view, otherwise type 0 -->
  7. <xsl:variable name="AUTODISPLACE" select="1"/>
  8.  
  9. <xsl:variable name="common-styles">
  10. <style type="text/css">
  11.  
  12. body {
  13.     font-family: Comic Sans MS;
  14.     background-color: #F8CC6E; }
  15.  
  16. div.channeltitle,
  17. div.newsitem,
  18. div.readnewsitem,
  19. div.flaggednewsitem {
  20.     display: block;
  21.     position: relative;
  22.  
  23.     width: 500px;
  24.  
  25.     border-top: 2px solid #666666;
  26.     margin: 20px 20px 20px 20px;
  27.     filter: progid:DXImageTransform.Microsoft.Shadow(color='#666666',direction=135,strength=4);
  28.     background-color: #FFFFAE; }
  29.     
  30. div.readnewsitem {
  31.     background-color: #EEEEFE;
  32.     background-color: #ECDCC2;    }
  33.     
  34. div.flaggednewsitem {
  35.     background-color: #FF7D7D;    }
  36.     
  37.  
  38. div.channeltitle {
  39.     display: block;
  40.     width: 50%;
  41.     height: 40px;
  42.     overflow: visible;
  43.  
  44.     padding: 10px 10px 10px 10px;
  45.     
  46.     font-size: 160%;
  47.     text-align: center; }
  48.  
  49. div.newsitemtitle {
  50.     display: block;
  51.     overflow: visible;    
  52.     height: 40px;
  53.  
  54.     padding: 10px 10px 10px 10px;
  55.  
  56.     font-size: 140%;
  57.     text-align: center; }
  58.  
  59.  
  60. div.newsitemcontent {
  61.     display: block;
  62.     overflow: auto;
  63.  
  64.     padding: 10px 10px 10px 10px;
  65.  
  66.     font-size: 80%; }
  67.  
  68. div.readnewsitemdate,
  69. div.flaggednewsitemdate,
  70. div.newsitemdate {
  71.     display: block;
  72.     padding: 3px 15px 0px 15px;
  73.  
  74.     height: 10px;
  75.     filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#AF984A,endColorStr=#FFFFAE);
  76.  
  77.     text-align: right;
  78.     font-size: 75%;
  79.     color: gray; }
  80.  
  81. div.readnewsitemdate {
  82.     filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#D1AD73,endColorStr=#ECDCC2); }
  83. div.flaggednewsitemdate {
  84.     filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#B04A4A,endColorStr=#FF7D7D); }
  85.  
  86.  
  87. div.newsitemfooter {
  88.     display: block;
  89.     padding: 3px 15px 10px 15px;
  90.     text-align: right;
  91.     font-size: 75%;
  92.     color: gray; }
  93.     
  94. div.newsitemdate a,
  95. div.newsitemtitle a,
  96. div.channeltitle a {
  97.     text-decoration: none;
  98.     color: black;
  99.     font-family: Comic Sans MS; }
  100.  
  101. blockquote { 
  102.     margin-left: 20px; 
  103.     margin-right: 20px; }
  104.  
  105. i,
  106. em { font-style: normal;    }
  107.  
  108. code, 
  109. pre, 
  110. tt { font-size: 90%; }
  111.  
  112. a { color: black; }
  113.  
  114. a:hover { color: blue; }
  115.  
  116. a img { border: 1px solid black; }
  117.  
  118. a:hover img { border: 1px solid blue; }
  119.  
  120. </style>
  121. </xsl:variable>
  122.  
  123. <xsl:variable name="StartupScript">
  124. <script type="text/javascript" language="JavaScript1.3">
  125. <![CDATA[
  126. function StartUp()
  127. {
  128.     maxWidth = window.document.body.clientWidth - 40;
  129.  
  130.     for(i = 0; i < 0 + 1*document.all.length; i++)
  131.     {
  132.         obj = document.all(i);
  133.         if( obj.tagName == 'DIV' && ( obj.className == 'newsitem' || obj.className == 'readnewsitem' || obj.className == 'flaggednewsitem' ) )
  134.         {
  135.             width = Math.round( Math.random() * 200 ) + 400;
  136.             obj.style.width = width;
  137.             obj.style.left = Math.round( Math.random() * (maxWidth - width) );
  138.         }
  139.     }
  140. }
  141. ]]>
  142. </script>
  143. </xsl:variable>
  144.  
  145. <!-- newsitem  -->
  146. <xsl:template match="item">
  147.     <div class="newsitem">
  148.         <xsl:if test="fd:state[@read='1']">
  149.             <xsl:attribute name="class">readnewsitem</xsl:attribute>
  150.         </xsl:if>
  151.         <xsl:if test="fd:state[@flagged='1']">
  152.             <xsl:attribute name="class">flaggednewsitem</xsl:attribute>
  153.         </xsl:if>
  154.  
  155.         <div class="newsitemdate">
  156.             <xsl:if test="fd:state[@read='1']">
  157.                 <xsl:attribute name="class">readnewsitemdate</xsl:attribute>
  158.             </xsl:if>
  159.             <xsl:if test="fd:state[@flagged='1']">
  160.                 <xsl:attribute name="class">flaggednewsitemdate</xsl:attribute>
  161.             </xsl:if>
  162.             <xsl:value-of select="fd:dateDisplay"/>
  163.         </div>
  164.  
  165.         <div class="newsitemtitle">
  166.             <a href="{link}" title="Click to open the newsitem's link. Hold SHIFT to open it in a new window">
  167.                 <xsl:attribute name="class"><xsl:choose><xsl:when test="fd:state[@flagged='1']">flagged</xsl:when><xsl:when test="fd:state[@read='1']">read</xsl:when></xsl:choose></xsl:attribute>
  168.                 <xsl:value-of select="title" disable-output-escaping="yes"/>
  169.             </a>
  170.         </div>
  171.         <div class="newsitemcontent">
  172.             <xsl:value-of select="description" disable-output-escaping="yes"/>
  173.         </div>
  174.  
  175.         <xsl:if test="category">
  176.             <div class="newsitemfooter">
  177.                 <br/>Category: <b>
  178.                     <xsl:value-of select="category" disable-output-escaping="yes"/>
  179.                 </b>
  180.             </div>
  181.         </xsl:if>
  182.         <xsl:if test="dc:subject">
  183.             <div class="newsitemfooter">
  184.         Subject: <b>
  185.                     <xsl:value-of select="dc:subject" disable-output-escaping="yes"/>
  186.                 </b>
  187.             </div>
  188.         </xsl:if>
  189.         <xsl:if test="author">
  190.             <div class="newsitemfooter">
  191.         Author: <b>
  192.                     <xsl:value-of select="author" disable-output-escaping="yes"/>
  193.                 </b>
  194.             </div>
  195.         </xsl:if>
  196.         <xsl:if test="comments">
  197.             <div class="newsitemfooter">
  198.                 <a href="{comments}">[Comments]</a>
  199.             </div>
  200.         </xsl:if>
  201.         <xsl:if test="enclosure">
  202.             <div class="newsitemfooter">
  203.                 <a href="{enclosure/@url}" title="{enclosure/@type} :   {enclosure/@url}"> [Enclosure : <xsl:value-of select="round( enclosure/@length div 1024 )"/> kB ]</a>
  204.             </div>
  205.         </xsl:if>
  206.         <xsl:if test="/newspaper/@type='newsitem'">
  207.             <div class="newsitemfooter">
  208.                 <!-- 
  209.             Important: use 'source' element here so that source channel shows for 
  210.             newsbins and watches.  For other channels, FeedDemon sets the source
  211.             to the channel itself.
  212.         -->
  213.         Source: <a href="{source/@htmlUrl}">
  214.                     <xsl:value-of select="source" disable-output-escaping="yes"/>
  215.                 </a>
  216.         |
  217.         <a href="{source/@url}">RSS</a> |
  218.     </div>
  219.         </xsl:if>
  220.     </div>
  221. </xsl:template>
  222. <!-- channel  -->
  223. <xsl:template match="channel">
  224.     <center>
  225.         <div class="channeltitle">
  226.             <a href="{link}" title="Click to open the channel's homepage. Hold SHIFT to open it in a new window">
  227.                 <xsl:value-of select="title"/>
  228.             </a>
  229.         </div>
  230.     </center>
  231.     <xsl:for-each select="item">
  232.         <xsl:sort select="fd:sortKey" data-type="number" order="ascending"/>
  233.         <xsl:apply-templates select="."/>
  234.     </xsl:for-each>
  235. </xsl:template>
  236. <!-- channel/group newspaper -->
  237. <xsl:template match="newspaper[@type='group' or @type='channel']">
  238.     <html>
  239.         <head>
  240.             <title>Group/Channel Newspaper</title>
  241.             <base href="{//item/channel}" />
  242.             <xsl:copy-of select="$common-styles"/>
  243.             <xsl:copy-of select="$StartupScript"/>
  244.         </head>
  245.         <body>
  246.         <xsl:if test="$AUTODISPLACE = 1">
  247.             <xsl:attribute name="onload">StartUp();</xsl:attribute>
  248.         </xsl:if>
  249.             <xsl:for-each select="channel">
  250.                 <xsl:apply-templates select="."/>
  251.             </xsl:for-each>
  252.         </body>
  253.     </html>
  254. </xsl:template>
  255. <!-- single news item -->
  256. <xsl:template match="newspaper[@type='newsitem']">
  257.     <html>
  258.         <head>
  259.             <title>News Item</title>
  260.             <base href="{//item/link}" />
  261.             <xsl:copy-of select="$common-styles"/>
  262.         </head>
  263.         <body>
  264.             <xsl:for-each select="channel/item">
  265.                 <xsl:apply-templates select="."/>
  266.             </xsl:for-each>
  267.         </body>
  268.     </html>
  269. </xsl:template>
  270. </xsl:stylesheet>
  271.